<?php
/* @var $this TicketController */
/* @var $ticket Ticket */
/* @var $form CActiveForm */
?>
<div class="form">
	<div class="section">
		<div class="block">
			<?php
			$form = $this->beginWidget('CActiveForm', array(
				'id' => 'ticket-create-form',
				'enableAjaxValidation' => false,
			));
			?>
			<table class="form-table">
				<tr>
					<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'name'); ?></th>
					<td>
						<?php echo $form->textField($ticket, 'name', array('size' => 30)); ?>
						<?php echo $form->error($ticket, 'name'); ?>
					</td>
				</tr>
				<tr>
					<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'email'); ?></th>
					<td>
						<?php echo $form->textField($ticket, 'email', array('size' => 30)); ?>
						<?php echo $form->error($ticket, 'email'); ?>
					</td>
				</tr>
				<tr>
					<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'mobile'); ?></th>
					<td>
						<?php echo $form->textField($ticket, 'mobile', array('size' => 30)); ?>
						<?php echo $form->error($ticket, 'mobile'); ?>
					</td>
				</tr>
				<tr>
					<td colspan="2">&nbsp;</td>
				</tr>
				<!-- <?php //if (!$ticket->isNewRecord): ?>
					<tr>
						<th scope="row" width="100"><?php //echo $form->labelEx($ticket, 'current_status', array('label' => 'Status')); ?></th>
						<td>
							<?php// echo $form->dropDownList($ticket, 'current_status', CHtml::listData(TicketStatusType::model()->findAll(), 'code', 'code')); ?>
							<?php //echo $form->error($ticket, 'current_status'); ?>
						</td>
					</tr>
				<?php// endif; ?> -->
				<tr>
					<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'ticket_type_id'); ?></th>
					<td>
						<?php echo $form->dropDownList($ticket, 'ticket_type_id', CHtml::listData(TicketType::model()->findAll(), 'id', 'name'), array('prompt' => 'Select Type')); ?>
						<?php echo $form->error($ticket, 'ticket_type_id'); ?>
					</td>
				</tr>
				
				
				<tr>
					<th scope="row">
						<?php echo $form->labelEx($ticket, 'ticket_source_id'); ?></th>
					<td>
						<?php echo $form->dropDownList($ticket, 'ticket_source_id', CHtml::listData(TicketSource::model()->findAll(), 'id', 'name'), array('prompt' => 'Select Source')); ?>
						<?php echo $form->error($ticket, 'ticket_source_id'); ?>
					</td>
				</tr>
				<tr>
					<th scope="row">
						<?php echo $form->labelEx($ticket, 'subject'); ?></th>
					<td>
						<?php echo $form->textField($ticket, 'subject', array('size' => 60)); ?>
						<?php echo $form->error($ticket, 'subject'); ?>
					</td>
				</tr>
				<tr>
					<th scope="row">
					<?php echo $form->labelEx($ticket,'summary'); ?></th>
					<td>
					
						<div class="ckeditor megin">
							<?php $this->widget('common.components.ckeditor.CKEditor', array(
								'model'=>$ticket,
								'attribute'=>'summary',
								'language'=>'en',
								'editorTemplate'=>'advanced',
								'width'	=>	'300px',
								'height'	=>	'420px',
								'options'=>array(
									//'filebrowserUploadUrl'=>$this->createUrl('upload'),
								),
								//'rows'=>10, 
								//'cols'=>30,
								'toolbar'=>array(
									array('Bold', 'Italic', 'Underline', 'Strike'),
									array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'),
									array('Format'),
									array( 'Font', 'FontSize', 'FontColor', 'TextColor'),
									'/',
									array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ),
									array('Image', 'Table', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'),
									array('Subscript','Superscript'),
									array( 'Link', 'Unlink' ),
									array('Source'),
								)
								)); 
							?>
						</div>
					</td>
				</tr>
				<tr>
					<th scope="row">
						<?php echo $form->labelEx($ticket, 'ticket_priority_id'); ?></th>
					<td>
						<?php echo $form->dropDownList($ticket, 'ticket_priority_id', CHtml::listData(TicketPriority::model()->findAll(), 'id', 'name'), array('prompt' => 'Select Priority')); ?>
						<?php echo $form->error($ticket, 'ticket_priority_id'); ?>
					</td>
				</tr>
			</table>
			<div class="row buttons">
				<?php if ($ticket->isNewRecord): ?>
					<?php echo CHtml::submitButton('Submit Ticket', array('class' => 'green')); ?>
				<?php else: ?>
					<?php echo CHtml::submitButton('Update Ticket', array('class' => 'green')); ?>
				<?php endif; ?>

			</div>
			<?php $this->endWidget(); ?>
		</div>
	</div>
</div><!-- form -->